<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
    <meta charset="UTF-8">
    <title>Spring Boot</title>
</head>
<body>
<div th:replace="~{fragments/header :: header}"></div>

<h1 th:text="${title}"></h1>
<div>
    <a th:href="@{/users/form}">创建用户</a>
</div>
<table border="1">
    <thead>
        <tr>
            <th>ID</th>
            <th>Age</th>
            <th>Name</th>
        </tr>
    </thead>
    <tbody>
        <tr th:if="${userModel.userList.size()} eq 0">
            <td colspan="3">没有用户信息</td>
        </tr>
        <tr th:each="user : ${userModel.userList}">
            <td th:text="${user.id}"></td>
            <td th:text="${user.age}"></td>
            <td>
                <a href="#" th:href="@{'/users/get/'+${user.id}}" th:text="${user.name}"></a>
            </td>
        </tr>
    </tbody>
</table>


<div th:replace="~{fragments/footer :: footer}"></div>
</body>
</html>